Skip to content

carry a monotonous long step counter in Authorizer - #162

Merged
Korbik merged 2 commits into
mainfrom
clementd/make-stepbudget.step-throw-and-combinator-yield-result
Nov 21, 2026
Merged

Korbik merged 2 commits into
mainfrom
clementd/make-stepbudget.step-throw-and-combinator-yield-result

Conversation

@divarvel

Copy link
Copy Markdown
Contributor

#153 was based on an earlier design of the rust implementation.

This PRs aligns biscuit-java with biscuit-rust:

  • Authorizer carries a monotonous step counter
  • budget is provided by call sites and not persisted
  • Combinator yields an error when the step budget is exceeded
  • StepBudget.step() throws so that callers don’t need to manually check if budget is exceeded
  • use long instead of int for steps since rust and protobuf expose an u64 value

@divarvel
divarvel force-pushed the clementd/make-stepbudget.step-throw-and-combinator-yield-result branch 2 times, most recently from 687a84a to e2e3014 Compare November 21, 2026 21:42
- carry the step counter in Authorizer
- make it monotonous
- check the current step counter against a budget that can be overriden at
call sites
- make step count `long` to align with the rust implementation and the protobuf representation
This removes the need for explicitly checking `StepBudget.exceeded()`
@divarvel
divarvel force-pushed the clementd/make-stepbudget.step-throw-and-combinator-yield-result branch from e2e3014 to 343a8b8 Compare November 21, 2026 21:50

@Korbik Korbik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Korbik
Korbik merged commit 4090dfa into main Nov 21, 2026
2 checks passed
@Korbik
Korbik deleted the clementd/make-stepbudget.step-throw-and-combinator-yield-result branch November 21, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants